<template>
  <div>
    <h1>{{brand.name}}</h1>
  </div>
</template>

<script>
import axios from "axios"
export default {
  data() {
    return {
      brand: {}
    };
  },
  created() {
    //获取路由参数中的id
    // alert(this.$route.params.id)
    axios({
      url: "http://localhost:9999/api/getprodlist"
    }).then(res => {
      this.brand = res.data.data.find(v => {
        return v._id == this.$route.params.id;
      });
    });
  }
};
</script>

<style>

</style>
